# import requests
# from lxml import etree
# from log.header import get_headers
# requests = requests.Session()
#
# url = 'https://www.lagou.com/wn/zhaopin?kd=Python&pn=1'
#
# res = requests.get(url,headers=get_headers('https://www.lagou.com/wn/zhaopin?kd=Python&pn=1'))
#
# print(requests.cookies)
# print(res.url)

import requests

cookies = {
    'index_location_city': '%E5%85%A8%E5%9B%BD',
    'Hm_lvt_4233e74dff0ae5bd0a3d81c6ccf756e6': '1761982563',
    'HMACCOUNT': 'D4B399F60924DE51',
    '_ga': 'GA1.2.936353026.1761982563',
    '_gid': 'GA1.2.2106982861.1761982563',
    'sajssdk_2015_cross_new_user': '1',
    'user_trace_token': '20251101153603-9fa685ca-6e11-4902-a92b-a694498b71dc',
    'LGSID': '20251101153603-900588f4-3d5d-4d8c-b78b-705e4727f15b',
    'PRE_UTM': '',
    'PRE_HOST': '',
    'PRE_SITE': '',
    'PRE_LAND': 'https%3A%2F%2Fpassport.lagou.com%2Flogin%2Flogin.html%3Fmsg%3Dneedlogin%26clientIp%3D115.60.13.46',
    'LGUID': '20251101153603-fedd255b-c319-4d62-acab-5d77133ddbcf',
    'LG_HAS_LOGIN': '1',
    '_putrc': 'CAA9B97014C15D5D123F89F2B170EADC',
    'JSESSIONID': 'ABAABJAABCFAAAHD52D9EFE69546ABF34B6309FE6D72111',
    'login': 'true',
    'unick': '%E7%94%A8%E6%88%B71179',
    'hasDeliver': '0',
    'privacyPolicyPopup': 'false',
    'WEBTJ-ID': '20251101153859-19a3e5af24417e6-0defa34ca6fb84-26061851-1296000-19a3e5af245288a',
    'sensorsdata2015session': '%7B%7D',
    'Hm_lpvt_4233e74dff0ae5bd0a3d81c6ccf756e6': '1761982960',
    '_ga_DDLTLJDLHH': 'GS2.2.s1761982563$o1$g1$t1761982960$j49$l0$h0',
    'LGRID': '20251101154240-4a04cb6f-74a9-4617-9e74-d954f4516652',
    'gate_login_token': 'v1####cce8f09f27238ced8531d6f95f82912184b41b6f515c3e3083404eb90d5bae16',
    'showExpriedIndex': '1',
    'showExpriedCompanyHome': '1',
    'showExpriedMyPublish': '1',
    'sensorsdata2015jssdkcross': '%7B%22distinct_id%22%3A%2219a3e5843e4c3d-0af6938c02778d8-26061851-1296000-19a3e5843e51e6a%22%2C%22%24device_id%22%3A%2219a3e5843e4c3d-0af6938c02778d8-26061851-1296000-19a3e5843e51e6a%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24os%22%3A%22Windows%22%2C%22%24browser%22%3A%22Chrome%22%2C%22%24browser_version%22%3A%22141.0.0.0%22%7D%7D',
}

headers = {
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Referer': 'https://www.lagou.com/wn/zhaopin?kd=Python&pn=3',
    'Sec-Fetch-Dest': 'document',
    'Sec-Fetch-Mode': 'navigate',
    'Sec-Fetch-Site': 'same-origin',
    'Sec-Fetch-User': '?1',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
    'sec-ch-ua': '"Google Chrome";v="141", "Not?A_Brand";v="8", "Chromium";v="141"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    # 'Cookie': 'index_location_city=%E5%85%A8%E5%9B%BD; Hm_lvt_4233e74dff0ae5bd0a3d81c6ccf756e6=1761982563; HMACCOUNT=D4B399F60924DE51; _ga=GA1.2.936353026.1761982563; _gid=GA1.2.2106982861.1761982563; sajssdk_2015_cross_new_user=1; user_trace_token=20251101153603-9fa685ca-6e11-4902-a92b-a694498b71dc; LGSID=20251101153603-900588f4-3d5d-4d8c-b78b-705e4727f15b; PRE_UTM=; PRE_HOST=; PRE_SITE=; PRE_LAND=https%3A%2F%2Fpassport.lagou.com%2Flogin%2Flogin.html%3Fmsg%3Dneedlogin%26clientIp%3D115.60.13.46; LGUID=20251101153603-fedd255b-c319-4d62-acab-5d77133ddbcf; LG_HAS_LOGIN=1; _putrc=CAA9B97014C15D5D123F89F2B170EADC; JSESSIONID=ABAABJAABCFAAAHD52D9EFE69546ABF34B6309FE6D72111; login=true; unick=%E7%94%A8%E6%88%B71179; hasDeliver=0; privacyPolicyPopup=false; WEBTJ-ID=20251101153859-19a3e5af24417e6-0defa34ca6fb84-26061851-1296000-19a3e5af245288a; sensorsdata2015session=%7B%7D; Hm_lpvt_4233e74dff0ae5bd0a3d81c6ccf756e6=1761982960; _ga_DDLTLJDLHH=GS2.2.s1761982563$o1$g1$t1761982960$j49$l0$h0; LGRID=20251101154240-4a04cb6f-74a9-4617-9e74-d954f4516652; gate_login_token=v1####cce8f09f27238ced8531d6f95f82912184b41b6f515c3e3083404eb90d5bae16; showExpriedIndex=1; showExpriedCompanyHome=1; showExpriedMyPublish=1; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2219a3e5843e4c3d-0af6938c02778d8-26061851-1296000-19a3e5843e51e6a%22%2C%22%24device_id%22%3A%2219a3e5843e4c3d-0af6938c02778d8-26061851-1296000-19a3e5843e51e6a%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24os%22%3A%22Windows%22%2C%22%24browser%22%3A%22Chrome%22%2C%22%24browser_version%22%3A%22141.0.0.0%22%7D%7D',
}

params = {
    'kd': 'Python',
    'pn': '1',
}

response = requests.get('https://www.lagou.com/wn/zhaopin', params=params, cookies=cookies, headers=headers)

print(response.status_code)
print(response.text)